#coding: utf-8
class RequestAndComplaint::ComplaintType < ActiveRecord::Base  
  has_many :complaint, :class_name => 'RequestAndComplaint::Complaint', :foreign_key => 'complaint_type'
  default_scope where("deleted = 0")

  def erasable
    type = RequestAndComplaint::Complaint.count_complaint_type_dependencies(id)
    if type >0
      return "Imposible borrar. Existen dependencias en denuncia"   
    end
    return nil
  end
end
